package wh.coach._inneer_class;

/**
 * @author hangwen
 * @date 2023/6/28
 */
public class Out {

    private final String name;

    public Out(final String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void outInnerName() {
        final Inner in1 = new Inner("in1");
        System.out.println(in1.getName());
        final Inner in2 = new Inner("in2");

        final Out out1 = in1.out();
        final Out out2 = in2.out();
        final Out out3 = this;
    }

    static class Inner2 {
        private final String myName;

        Inner2(final String myName) {
            this.myName = myName;
        }
    }

    class Inner {
        private final String myName;

        Inner(final String myName) {
            this.myName = myName;
        }

        public String getName() {
            return Out.this.name + "," + this.myName;
        }

        public Out out() {
            return Out.this;
        }
    }
}
